const mongoose = require('mongoose');
const Schema = mongoose.Schema;


const orderSchema = new mongoose.Schema({
    id: { type: Number, required: true },
    serviceId: { type: Schema.Types.ObjectId, ref: 'Service', required: true },
    shopName: { type: String, required: true },
    title: { type: String, required: true },
    img: { type: String, required: true },
    expiry: { type: String, required: true },
    tags: { type: [String], required: true },
    price: { type: Number, required: true },
    count: { type: Number, required: true },
    status:{ type: Number, default: 0 }, // 0 待使用，1 已预约，2 待评价
}, { timestamps: true });

module.exports = mongoose.model('Order', orderSchema);
